<template>
	<view>
		<view class="special-work-list__group">
      <view v-if="ticket.workType === '5'" class="special-work-list__item flex-col">
        <text class="special-work-list__label">起重吊装作业专项安全检查表</text>
        <view class="mb-20">
          <image-upload v-if="safeCheckTable" :image-url="safeCheckTable" />
          <text v-else>--</text>
        </view>
      </view>
      <view v-if="ticket.workType === '9'" class="flex-col">
        <text class="special-work-list__label">设备检维修作业(交付验收)单</text>
        <view class="mb-20">
          <image-upload v-if="acceptanceFile" :image-url="acceptanceFile" />
          <text v-else>--</text>
        </view>
      </view>
      <view class="flex-col">
        <text class="special-work-list__label">其他附件</text>
        <view class="mb-20">
          <image-upload v-if="otherFile" :image-url="otherFile" />
          <text v-else>--</text>
        </view>
      </view>
		</view>
	</view>
</template>

<script>
import { staticUrl } from '@/config.js'
import ImageUpload from '@/components/image-upload/index.vue';

export default {
	props: {
		detail: {
			type: Object,
			default: () => ({})
		},
		ticket: {
			type: Object,
			default: () => ({})
		},
		inspect: {
			type: Object,
			default: () => ({})
		}
	},
	components: {
    ImageUpload,
	},
	computed: {
    safeCheckTable() {
      return this.ticket.acceptanceFile?.safeCheckTable || ''
    },
    acceptanceFile() {
      return this.ticket.acceptanceFile?.acceptanceFile || ''
    },
    otherFile() {
      // return this.ticket.acceptanceFile?.otherFile || '/minio/pub/2023/08/21/lADPJv8gX97qfUjNB3vND0o_3914_1915_20230821105326A042.jpg, /minio/pub/2023/08/22/微信图片_20230214091753_20230822153929A197.jpg'
      return this.ticket.acceptanceFile?.otherFile || ''
    },
	},
	data() {
		return {
			staticUrl
		}
	},
	methods: {
		handlePreviewImage(url) {
			uni.previewImage({
				urls: [url]
			})
		}
	}
}
</script>

<style scoped lang="scss">
@import '../style/style.scss';
</style>
